package com.happy016.controller;

import com.happy016.exception.AjaxException;
import com.happy016.exception.ViewException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/exception")
public class ExceptionController {

    @RequestMapping("/ajax")
    @ResponseBody
    public String ajax() throws AjaxException {
        throw  new AjaxException("AJax Exception");
    }

    @RequestMapping("/view")
    public String view() throws ViewException {
        throw new ViewException("View Exception");
    }
}
